package com.gy.edu.mine;

import android.view.View;
import android.widget.ImageView;

import com.gy.edu.R;
import com.gy.edu.base.BaseActivity;

/**
 * 作者：gy on 16/12/22
 * 说明：
 */
public class SettingActivity extends BaseActivity {

    private ImageView imgLook,imgDown;
    private int look,down;

    @Override
    protected void initView() {
        setContentViewRes(R.layout.activity_setting);
        setTitleMsg("设置");
        imgLook = (ImageView) findViewById(R.id.setting_img_look);
        imgDown = (ImageView) findViewById(R.id.setting_img_down);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void setListener() {
        super.setListener();
        imgLook.setOnClickListener(this);
        imgDown.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.setting_img_look:
                look++;
                if(look % 2 == 1){
                    imgLook.setImageResource(R.mipmap.setting_checked_on);
                } else {
                    imgLook.setImageResource(R.mipmap.setting_checked_off);
                }
                break;
            case R.id.setting_img_down:
                down++;
                if(down % 2 == 1){
                    imgDown.setImageResource(R.mipmap.setting_checked_on);
                } else {
                    imgDown.setImageResource(R.mipmap.setting_checked_off);
                }
                break;
        }
    }
}
